﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BI.CF.Model;
using BI.CF.BLL;
using System.Data;

namespace BackStage
{
    public partial class BullUpt : System.Web.UI.Page
    {
        BulletinBLL bll = new BulletinBLL();
        BulletinModel model = new BulletinModel();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);
                ViewState["id"] = id;
                model = bll.Bullid(id);
                TextBox1.Text = model.BulletinID.ToString();
                TextBox2.Text = model.B_Tile;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            BulletinModel modelUpdate = new BulletinModel();
            modelUpdate.B_Tile = TextBox2.Text;
            modelUpdate.BulletinID = Convert.ToInt32(ViewState["id"]);
            if (bll.BullUpt(modelUpdate) == true)
            {
                Response.Write("<script>alert('更新成功');location.href='BulletinShowAll.aspx'</script>");
            }
        }
    }
}